package model

import (
	"github.com/gogf/gf/v2/os/gtime"
	"github.com/golang-jwt/jwt/v5"
)

type AuthRegisterInput struct {
	Username string `json:"username" v:"required" dc:"用户名"`
	Password string `json:"password" v:"required" dc:"密码"`
	Nickname string `json:"nickname" dc:"昵称"`
	Sex      int    `json:"sex" v:"integer|in:0,1,2" dc:"性别"`
}

type AuthLoginInPut struct {
	Username string `json:"username" v:"required#用户名不能为空" dc:"账号"`
	Password string `json:"password" v:"required#密码不能为空" dc:"密码"`
}

type AuthSMSLoginInPut struct {
	Cid     string `json:"cid" v:"required" dc:"区号"`
	Captcha string `json:"captcha" v:"required" dc:"验证码"`
	Mobile  string `json:"mobile" v:"required|phone" dc:"手机号"`
}

type AuthSMSCodeInput struct {
	Cid    string `json:"cid" v:"required" dc:"区号"`
	Mobile string `json:"mobile" v:"required|phone" dc:"手机号"`
	Type   string `json:"type" v:"required|in:login,forgot_pwd" dc:"业务编码"`
}

type AuthForgotPwdInput struct {
	Username string `json:"username" v:"required#用户名不能为空" dc:"账号"`
	Password string `json:"password" v:"required#密码不能为空" dc:"密码"`
	Cid      string `json:"cid" v:"required" dc:"区号"`
	Captcha  string `json:"captcha" v:"required" dc:"验证码"`
	Mobile   string `json:"mobile" v:"required|phone" dc:"手机号"`
}

type AdminClaims struct {
	UserId   uint64      `json:"user_id"`
	Username string      `json:"username"`
	Nickname string      `json:"nickname"`
	Avatar   string      `json:"avatar"`
	IsSuper  bool        `json:"super"`
	Role     string      `json:"role"`
	Device   string      `json:"device"`
	LoginIp  string      `json:"login_ip"`
	LoginAt  *gtime.Time `json:"login_at"`
}

type JwtClaims struct {
	*AdminClaims
	jwt.RegisteredClaims
}
